typedef struct {
GdkWindow *window;
GdkGLContext *shared_context;
+ GdkGLProfile profile;
guint realized : 1;
guint use_texture_rectangle : 1;
PROP_0,
PROP_WINDOW,
+ PROP_PROFILE,
PROP_SHARED_CONTEXT,
LAST_PROP
}
break;
+ case PROP_PROFILE:
+ priv->profile = g_value_get_enum (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
g_value_set_object (value, priv->shared_context);
break;
+ case PROP_PROFILE:
+ g_value_set_enum (value, priv->profile);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
+ /**
+ * GdkGLContext:profile:
+ *
+ * The #GdkGLProfile of the context
+ *
+ * Since: 3.16
+ */
+ obj_pspecs[PROP_PROFILE] =
+ g_param_spec_enum ("profile",
+ P_("Profile"),
+ P_("The GL profile the context was created for"),
+ GDK_TYPE_GL_PROFILE,
+ GDK_GL_PROFILE_DEFAULT,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS);
+
/**
* GdkGLContext:shared-context:
*
return priv->window;
}
+/**
+ * gdk_gl_context_get_profile:
+ * @context: a #GdkGLContext
+ *
+ * Retrieves the #GdkGLProfile that @context was created for.
+ *
+ * Returns: a #GdkGLProfile
+ *
+ * Since: 3.16
+ */
+GdkGLProfile
+gdk_gl_context_get_profile (GdkGLContext *context)
+{
+ GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
+
+ g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
+
+ return priv->profile;
+}
+
/**
* gdk_gl_context_get_shared_context:
* @context: a #GdkGLContext
return NULL;
}
+ if (profile == GDK_GL_PROFILE_DEFAULT)
+ profile = GDK_GL_PROFILE_LEGACY;
+
if (profile == GDK_GL_PROFILE_3_2_CORE &&
!display_wayland->have_egl_khr_create_context)
{
context = g_object_new (GDK_TYPE_WAYLAND_GL_CONTEXT,
"window", window,
+ "profile", profile,
"shared-context", share,
NULL);
/* GDK_GL_PROFILE_DEFAULT is currently
* equivalent to the LEGACY profile
*/
+ profile = GDK_GL_PROFILE_LEGACY;
glx_context = create_gl_context (display, config, share);
}
context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
"window", window,
+ "profile", profile,
"shared-context", share,
NULL);